package com.dong.test;

import com.dong.cjlibproxy.Chain;
import com.dong.cjlibproxy.ChainHandler;

import java.util.Arrays;
import java.util.List;

public class T110CGLibChain2 {
    static class ChainHandlerA extends ChainHandler{
        @Override
        protected void handleProcess() {
            System.out.println("handleProcess a");
        }
    }
    static class ChainHandlerB extends ChainHandler{
        @Override
        protected void handleProcess() {
            System.out.println("handleProcess b");
        }
    }
    static class ChainHandlerC extends ChainHandler{
        @Override
        protected void handleProcess() {
            System.out.println("handleProcess c");
        }
    }

    public static void main(String[] args) {
        List<ChainHandler> chainHandlers = Arrays.asList(new ChainHandlerA(), new ChainHandlerB(), new ChainHandlerC());
        Chain chain = new Chain(chainHandlers);
        chain.execute();;
    }
}
